﻿using Customer.Domain;
using Customer.Infrstructre.VendorManager;
using Customer.Read.API.Applcation.Command.VendorCommand;
using MediatR;

namespace Customer.Read.API.Applcation.CommandHandler.VendorCommandHandlers
{
    public class VendorDropCommandhandler : IRequestHandler<VendorDropCommand, List<Vendor>>
    {

        IVendorRepository _vendorRep;
        public VendorDropCommandhandler(IVendorRepository _vendorRep)
        {
            this._vendorRep = _vendorRep;
        }


        public async Task<List<Vendor>> Handle(VendorDropCommand request, CancellationToken cancellationToken)
        {
            return await _vendorRep.GetAllAsync();
        }
    }
}
